<?php if (!defined('THINK_PATH')) exit();?>

<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="__TMPL__Common/style/style.css" />
<script type="text/javascript" src="__TMPL__Common/js/check_dog.js"></script>
<script type="text/javascript" src="__TMPL__Common/js/IA300ClientJavascript.js"></script>
<script type="text/javascript">
	var ACTION_ID ='<?php echo $action_id ?>';
 	var VAR_MODULE = "<?php echo conf("VAR_MODULE");?>";
	var VAR_ACTION = "<?php echo conf("VAR_ACTION");?>";
	var MODULE_NAME	=	'<?php echo MODULE_NAME; ?>';
	var ACTION_NAME	=	'<?php echo ACTION_NAME; ?>';
	var ROOT = '__APP__';
	var ROOT_PATH = '<?php echo APP_ROOT; ?>';
	var CURRENT_URL = '<?php echo trim($_SERVER['REQUEST_URI']);?>';
	var INPUT_KEY_PLEASE = "<?php echo L("INPUT_KEY_PLEASE");?>";
	var TMPL = '__TMPL__';
	var APP_ROOT = '<?php echo APP_ROOT; ?>';
	var LOGINOUT_URL = '<?php echo u("Public/do_loginout");?>';
	var WEB_SESSION_ID = '<?php echo es_session::id(); ?>';
	var EMOT_URL = '<?php echo APP_ROOT; ?>/public/emoticons/';
	var MAX_FILE_SIZE = "<?php echo (app_conf("MAX_IMAGE_SIZE")/1000000)."MB"; ?>";
	var FILE_UPLOAD_URL ='<?php echo u("File/do_upload");?>' ;
	CHECK_DOG_HASH = '<?php $adm_session = es_session::get(md5(conf("AUTH_KEY"))); echo $adm_session["adm_dog_key"]; ?>';
	function check_dog_sender_fun()
	{
		window.clearInterval(check_dog_sender);
		check_dog2();
	}
	var check_dog_sender = window.setInterval("check_dog_sender_fun()",5000);
	
</script>
	<script type="text/javascript" src="__TMPL__Common/js/cropper/jquery.min.js"></script>
<script type="text/javascript" src="__TMPL__Common/js/jquery.timer.js"></script>

<link rel="stylesheet" type="text/css" href="__TMPL__Common/style/weebox.css" />
<script type="text/javascript" src="__TMPL__Common/js/jquery.bgiframe.js"></script>
<script type="text/javascript" src="__TMPL__Common/js/jquery.weebox.js"></script>
<link rel="stylesheet" type="text/css" href="__TMPL__Common/js/cropper/cropper.min.css" />
<link rel="stylesheet" type="text/css" href="__TMPL__Common/js/cropper/main.css" />
<script type="text/javascript" src="__TMPL__Common/js/cropper/cropper.min.js"></script>

<script type="text/javascript" src="__TMPL__Common/js/script.js"></script>
<script type="text/javascript" src="__ROOT__/public/runtime/admin/lang.js"></script>
<script type='text/javascript'  src='__ROOT__/admin/public/kindeditor/kindeditor.js'></script>
<script type='text/javascript'  src='__ROOT__/admin/public/kindeditor/lang/zh_CN.js'></script>


</head>
<body onLoad="javascript:DogPageLoad();">
<div id="info"></div>

<script type="text/javascript" src="__TMPL__Common/js/bm/BmPromoter.js"></script>
<div class="main">
<div class="main_title">一级单位<?php echo L("ADD");?> <a href="<?php echo u("BmPromoterOne/index");?>" class="back_list"><?php echo L("BACK_LIST");?></a></div>
<div class="blank5"></div>
<form name="edit" action="__APP__" method="post" enctype="multipart/form-data" onsubmit="return check();">
<table class="form" cellpadding=0 cellspacing=0>
	<tr>
		<td colspan=2 class="topTd"></td>
	</tr>
	<tr>
		<td class="item_title">登录手机号:</td>
		<td class="item_input"><input type="text" class="textbox require" name="mobile" /></td>
	</tr>
	<tr>
		<td class="item_title">密码:</td>
		<td class="item_input">
			<input type="text" class="textbox" name="pwd" />
			<span class="tip_span"><span class="tip_span">密码为空时，默认密码为123456</span>
		</td>
	</tr>
	<tr>
		<td class="item_title">绑定会员:</td>
		<td class="item_input">
			<input type="text" class="textbox require" name="binding_mobile" value="" />
			<input type="hidden" class="" name="binding_user_id_old" value="0" />
			<span class="tip_span">新增一级单位需要绑定已注册的会员手机号</span>
		</td>
	</tr>
	<tr>
		<td class="item_title">绑定会员信息:</td>
		<td class="item_input">
			<span id="binding_user_id">输入绑定会员手机号</span>
		</td>
	</tr>
	<tr>
		<td class="item_title">一级单位名称:</td>
		<td class="item_input"><input type="text" class="textbox require" name="name" /></td>
	</tr>
	<tr>
		<td class="item_title">状态:</td>
		<td class="item_input">
			<lable>有效<input type="radio" name="is_effect" value="1" checked="checked"></lable>
			<lable>无效<input type="radio" name="is_effect" value="0" ></lable>
		</td>
	</tr>
	
	
	<tr>
		<td class="item_title"></td>
		<td class="item_input">
			<!--隐藏元素-->
			<input type="hidden" name="<?php echo conf("VAR_MODULE");?>" value="BmPromoterOne" />
			<input type="hidden" name="<?php echo conf("VAR_ACTION");?>" value="insert" />
			<!--隐藏元素-->
			<input type="submit" class="button" value="<?php echo L("ADD");?>" />
			<input type="reset" class="button" value="<?php echo L("RESET");?>" />
		</td>
	</tr>
	<tr>
		<td colspan=2 class="bottomTd"></td>
	</tr>
</table>	 
</form>
    <script>
		$(document).ready(function(){
		    //var isSearch = false;
//			$("input[name='binding_mobile']").bind('blur', function() {
//				var binding_mobile= $("input[name='binding_mobile']").val();
//                if(binding_mobile ==''){
//                    //$(".err_span").html('');
//                    //$(this).parent(".item_input").append("<span class='tip_span err_span' style='color:#ff2200'>请输入手机号码</span>");
//					alert("请输入手机号码");
//                    $("input[name='binding_mobile']").val('');
//                    $("#binding_user_id").html("");
//                    return false;
//                }
//                var myreg = /^(1[0-9]{10})$/;
//                if(!myreg.test(binding_mobile))
//                {
//                    //$(".err_span").html('');
//                    //$(this).parent(".item_input").append("<span class='tip_span err_span' style='color:#ff2200'>请输入有效的手机号码</span>");
//                    alert("请输入有效的手机号码");
//                    $("input[name='binding_mobile']").val('');
//                    $("#binding_user_id").html("");
//                    return false;
//                }
//                isSearch = true;
//                $(".err_span").remove();
//                setTimeout(function(){
//                    $.ajax({
//                        url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=check_user&binding_mobile="+binding_mobile,
//                        data: "ajax=1",
//                        dataType: "json",
//                        success: function(obj){
//                            isSearch = false;
//                            if(obj.status=='1')
//                            {
//                                alert("有效会员");
//                                $("#binding_user_id").html("ID："+obj.user.id+", 呢称："+obj.user.nick_name);
//                            }
//                            else if(obj.status=='0')
//                            {
//                                alert(obj.info);
//                                $("input[name='binding_mobile']").val('');
//                                $("#binding_user_id").html("");
//
//                            }
//
//                        }
//                    });
//				},500);

//                $.ajax({
//                        url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=check_user&binding_mobile="+binding_mobile,
//                        data: "ajax=1",
//                        dataType: "json",
//                        success: function(obj){
//                            isSearch = false;
//                            if(obj.status=='1')
//                            {
//                                //alert("有效会员");
//                                $("#binding_user_id").html("ID："+obj.user.id+", 呢称："+obj.user.nick_name);
//                            }
//                            else if(obj.status=='0')
//                            {
//                                alert(obj.info);
//                                $("input[name='binding_mobile']").val('');
//                                $("#binding_user_id").html("");
//
//                            }
//
//                        }
//                    });
//
//           });
		});

    </script>
</div>
</body>
</html>